package drytools.site.css;

import drytools.site.model.Editable;

public class EditableCSSProperty extends Editable {
	public static final String UNSET = "null";
	String name;
	String value;
	String editorName;

	public String getEditorName() {
		if (!isEditMode())
			return "";

		if (editorName == null) {
			editorName = "string";
			if (name.indexOf("color") != -1) {
				editorName = "color";
			}
		}
		return editorName;
	}

	public void setEditorName(String editorName) {
		this.editorName = editorName;
	}

	public EditableCSSProperty(String name, String value) {
		super();
		this.name = name;
		this.value = value;
	}

	public String getName() {
		if (name == null || name.trim().length() == 0) {
			return UNSET;
		}
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getValue() {
		if (value == null || value.trim().length() == 0) {
			return UNSET;
		}
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

}
